<?php

namespace app\validate\admin;

use app\common\validate\BaseValidate;

/**
 * Class Validate
 * https://www.kancloud.cn/manual/thinkphp6_0/1037624
 * @package app\daily\validate
 */
class Game extends BaseValidate
{
    //定义验证规则
    protected $rule = [
        'game_title|游戏名称' => 'require|max:10|unique:game',
        'game_cover|游戏封面' => 'require',
        'sort|排序' => 'require|number',
    ];

    //定义验证场景要与方法名相同走自动验证
    protected $scene = [
        'create' => ['game_title', 'game_cover', 'sort'],
        'update' => ['game_title', 'game_cover', 'sort'],
    ];

}
